﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Marvin.Data.Linq2Sql;

namespace Marvin.Data.Entities
{
    public abstract class EntityBase : IEntity
    {
        #region Encapsulating an IDataEntity
        protected virtual IDataEntity DataEntity
        {
            get;
            set;
        }
        #endregion

        #region Properties
        public virtual int Id
        {
            get;
            set;
        }

        public Guid UserId
        {
            get
            {
                return DataEntity.UUserId;
            }
            set
            {
                DataEntity.UUserId = value;
            }
        }

        public bool Active
        {
            get
            {
                return DataEntity.BActive;
            }
            set
            {
                DataEntity.BActive = value;
            }
        }

        public DateTime Inserted
        {
            get
            {
                return DataEntity.DInserted;
            }
            set
            {
                DataEntity.DInserted = value;
            }
        }

        public DateTime? Updated
        {
            get
            {
                return DataEntity.DUpdated;
            }
            set
            {
                DataEntity.DUpdated = value;
            }
        }

        public DateTime? Deleted
        {
            get
            {
                return DataEntity.DDeleted;
            }
            set
            {
                DataEntity.DDeleted = value;
            }
        }
        #endregion
    }
}